from pydantic import BaseModel
from enum import Enum
from typing import List

class ResultEnum(Enum):
    SUCCESS=1
    FAILURE=2


class ResponseModel(BaseModel):
    result:ResultEnum=ResultEnum.SUCCESS

class UserModel(BaseModel):
    id:int
    mobile:str
    username:str
    avatar:str
    is_active:bool
    is_staff:bool
    
class UserListModel(BaseModel):
    user_list:List[UserModel]
    total:int
    
class LoginedModel(BaseModel):
    user:UserModel
    access_token:str
    refresh_token:str
    
class UpdatedAvatarModel(BaseModel):
    file_url:str
    
class AddressResponseModel(BaseModel):
    id:str
    realname:str
    mobile:str
    region:str
    detail:str
    
class AddressListModel(BaseModel):
    address_list:List[AddressResponseModel]
    total:int